package editAir.buildEdit
{
	import _me.Scene_data;
	
	import flash.display.BitmapData;
	import flash.display3D.Context3D;
	import flash.display3D.Context3DTextureFormat;
	import flash.display3D.textures.Texture;
	
	import robotleMvc.ui.uiContainers.TipLevelContainer;
	import robotleMvc.ui.uiContainers.WindowsLevel;

	public class EditManage
	{
		public static var tipLevelContainer:TipLevelContainer;
		public static var windowsLevel:WindowsLevel;
		public static var buildView:BuildEditLevel
		public static var buildEidtChooseText:Texture;
		public static var chooseBuildEditSprite:BuildEditDisplay3DSprite;
		//public static var sceneCanCatch:Boolean=true;
		public static var notChangeOther:Boolean=true;



		public function EditManage()
		{
		}

		public static function addWindows():void
		{

		}
		public static function makeBuildEidtChooseText():void
		{

			var context3D:Context3D=Scene_data.context3D
			var tempBmp:BitmapData=new BitmapData(64, 64, true, 0x88ff0000)
			buildEidtChooseText=context3D.createTexture(tempBmp.width, tempBmp.height, Context3DTextureFormat.BGRA, true);
			buildEidtChooseText.uploadFromBitmapData(tempBmp);

			Scene_data.sceneLightText=context3D.createTexture(tempBmp.width, tempBmp.height, Context3DTextureFormat.BGRA, true);
			Scene_data.sceneLightText.uploadFromBitmapData(new BitmapData(64, 64, false, 0xffffff));


		}

		public static function sendEvent(evt:BuildEditEventVO):void
		{
			switch (evt.eventID)
			{
				case BuildEditEvent.SET_BUILD_LIST_SOURCE:
			
					break;
				case BuildEditEvent.BUILD_EDIT_LIST_CELL_CLIK:
					chooseSampleBuild(evt.source);
					break;
				case BuildEditEvent.ADD_BUILD_OBJ:
				
					break;
				case BuildEditEvent.DELE_BUILD_OBJ:
					deleBuildObj();
					break;
				case BuildEditEvent.OPEN_CAN_EDIT_OBJ:
					
					break;
				default:
					break;
			}
		}
		
		
		
		
		private static function deleBuildObj():void
		{
			
		}
		private static function chooseSampleBuild(_tempSpriteVO:BuildEditDisplay3DSprite):void
		{

			chooseBuildEditSprite=_tempSpriteVO;
			for each (var tempSprite:BuildEditDisplay3DSprite in BuildEditLevel.buildItem)
			{
				if (!_tempSpriteVO || _tempSpriteVO.id != tempSprite.id)
				{
					tempSprite.isChoose=false;
				}
				trace(tempSprite.id);
			}

       
		}

		

	}
}
